package com.eling.elcms.travel.model;

import com.eling.elcms.core.dao.annotation.In;
import com.eling.elcms.core.model.BaseModel;
import com.eling.elcms.system.model.CommonUser;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;

import javax.persistence.*;
import java.util.Date;

/**
 * 散客退房结算确认
 * 
 * @author zhoulin
 *
 */
@Entity
@Indexed
@Table(name = "travel_checkoutsetlconfirm")
public class CheckOutSetlConfirm extends BaseModel {

	private static final long serialVersionUID = 5937568805793543003L;

	@Id
	@In
	@DocumentId
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long pkCheckOutSetlConfirm;

	/** 退房结算 */
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkCheckOutDeal")
	@IndexedEmbedded(depth = 1)
	private CheckOutDeal checkOutDeal;

	/** 款项内容 */
	@Column(length = 255)
	@Field
	private String content;

	/** 收款单位 */
	@Column(length = 127)
	@Field
	private String settelmentUnit;

	/** 确认人 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkUser")
	@IndexedEmbedded(depth = 1)
	private CommonUser confirmOperator;

	/** 确认日期 */
	@Field
	@Column
	private Date confirmDate;

	@Version
	private Integer version;

	public Long getPkCheckOutSetlConfirm() {
		return pkCheckOutSetlConfirm;
	}

	public void setPkCheckOutSetlConfirm(Long pkCheckOutSetlConfirm) {
		this.pkCheckOutSetlConfirm = pkCheckOutSetlConfirm;
	}

	public CheckOutDeal getCheckOutDeal() {
		return checkOutDeal;
	}

	public void setCheckOutDeal(CheckOutDeal checkOutDeal) {
		this.checkOutDeal = checkOutDeal;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getSettelmentUnit() {
		return settelmentUnit;
	}

	public void setSettelmentUnit(String settelmentUnit) {
		this.settelmentUnit = settelmentUnit;
	}

	public CommonUser getConfirmOperator() {
		return confirmOperator;
	}

	public void setConfirmOperator(CommonUser confirmOperator) {
		this.confirmOperator = confirmOperator;
	}

	public Date getConfirmDate() {
		return confirmDate;
	}

	public void setConfirmDate(Date confirmDate) {
		this.confirmDate = confirmDate;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

}
